<!DOCTYPE html>
<html>
  <head>
    <title>Queue/Dequeue</title>
    <link rel="stylesheet" type="text/css" href="../styles/core.css">
    <script type="text/javascript" src="../../../script/jquery/jquery-1.6.4.js"></script>
    <script type="text/javascript" src="../scripts/jqia2.support.js"></script>
    <script type="text/javascript">
      $(function() {

        $('img').queue('chain',
         function(){ say('First: ' + $(this).attr('alt')); });
        $('img').queue('chain',
          function(){ say('Second: ' + $(this).attr('alt')); });
        $('img').queue('chain',
          function(){ say('Third: ' + $(this).attr('alt')); });
        $('img').queue('chain',
          function(){ say('Fourth: ' + $(this).attr('alt')); });

        $('button').click(function(){
          $('img').dequeue('chain');
        });

      });
    </script>
  </head>

  <body>

    <div>
      <img src="earth.png" alt="Earth"/>
      <img src="moon.png" alt="Moon"/>
    </div>

    <button type="button" class="green90x24">Dequeue</button>

  </body>
</html>
